/*
* @author Ali Ok / Oleg Varaksin
* $$Id: AbstractFaceletsInspector.java 50 2011-01-29 00:24:11Z mcaliskan $$
*/

package com.googlecode.jsf2inspector.plugin.commons;

import com.googlecode.jsf2inspector.plugin.model.Tag;
import org.codehaus.plexus.util.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.List;

public abstract class AbstractFaceletsInspector extends AbstractInspector<File>
{

    /**
    * @parameter
    */
    protected List<Tag> tags;

    public List<Tag> getTags() {
        return tags;
    }

    public String getFileContent(File file) {
        try {
            // read file content using the platform encoding
            return FileUtils.fileRead(file);

        } catch (IOException e) {
            // don't break running, just log error
            processMojo.getLog().error("Unable to read the content of the file " + file.toString());
            return null;
        }
    }
}
